package com.company.design.jd_factory;

// 工厂类，设置一个工厂去创建对象
public class CarFactory {
    public static Car produce (String band){
        if("benz".equals(band)){
            return new Benzh();
        }else if("audi".equals(band)){
            return  new Audi();
        }else if("suzuki".equals(band)){
            return new Suzuki();
        }else {
            return null;
        }
    }
}
